home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_a
/
fwa.bas
< prev
next >
Wrap
BASIC Source File
|
1995-04-22
|
2KB
|
63 lines
10 REM INITIALIZE
20 GOSUB 29000
30 REM GET PIC NAME
40 ? "ENTER FILESPEC";:INPUT PIC$
50 REM LOAD PICTURE
60 GOSUB 29200
70 GOTO 70
29000 REM --Init for Fun with Art--
29010 REM Call only once
29020 MX=7:DIM CIO$(MX)
29030 FOR I=1 TO MX:READ J:CIO$(I)=CHR$(J):NEXT I
29040 DATA 104,104,104,170,76,86,228
29050 MX=15:DIM PIC$(MX):REM Use PIC$ to hold the filename
29060 DIM DLION$(MX)
29070 FOR I=1 TO MX:READ J:DLION$(I)=CHR$(J):NEXT I
29080 DATA 104,169,192,141,232,6,162,6,160,221
29090 DATA 169,6,76,92,228
29092 MX=18:DIM DLIOFF$(MX)
29094 FOR I=1 TO MX:READ J:DLIOFF$(I)=CHR$(J):NEXT I
29096 DATA 104,169,64,141,232,6,141,14,212,162
29098 DATA 228,160,95,169,6,76,92,228
29100 REM
29110 REM Init variables and steal some memory from BASIC
29120 REM
29130 IOCB=848:OLDSCL=PEEK(560):OLDSCH=PEEK(561)
29140 PICBAS=(INT(PEEK(742)/16)-2)*16
29150 DLIBAS=PICBAS-9:POKE 741,0:POKE 742,DLIBAS
29160 RETURN
29200 REM --Load & Show FWA Picture--
29210 REM NOTE:This routine returns A=-1 if it does not identify the picture as a FWA file
29220 GOSUB 29600:TRAP 29500:REM Make sure the DLI's are off
29230 OPEN #1,4,0,PIC$:GET #1,A:GET #1,B:REM I.D. BYTES
29240 IF A<>B THEN CLOSE #1:A=-1:RETURN :REM NOT A FWA PIC
29250 IF A<>254 THEN CLOSE #1:A=-1:RETURN :REM NOT A FWA PIC
29260 REM Get playfield colors
29270 GET #1,A:POKE 712,A:REM COLBK
29280 FOR I=0 TO 2:GET #1,A:POKE 708+I,A:NEXT I
29290 REM -Read Display List into Page 6
29300 POKE IOCB+4,0:POKE IOCB+5,6
29310 POKE IOCB+8,0:POKE IOCB+9,1
29320 A=USR(ADR(CIO$),16)
29330 REM --Read Screen Data--
29340 POKE IOCB+4,0:POKE IOCB+5,PICBAS
29350 POKE IOCB+8,16:POKE IOCB+9,30
29360 A=USR(ADR(CIO$),16)
29370 REM --Read DLI Routines--
29380 POKE IOCB+4,0:POKE IOCB+5,DLIBAS
29390 POKE IOCB+8,0:POKE IOCB+9,9
29400 A=USR(ADR(CIO$),16)
29410 CLOSE #1:OLDSCL=PEEK(560):OLDSCH=PEEK(561)
29420 REM --Show Picture on Screen--
29430 POKE 1541,PICBAS:POKE 1645,PICBAS+16
29440 POKE 1758,2:POKE 1763,DLIBAS
29450 POKE 560,0:POKE 561,6
29460 A=USR(ADR(DLION$))
29470 A=0:RETURN
29500 REM --ERROR TRAP HANDLER--
29510 CLOSE #1:A=-1:RETURN
29600 REM --Restore the Basic Text Screen--
29610 A=USR(ADR(DLIOFF$))
29620 POKE 560,OLDSCL:POKE 561,OLDSCH
29630 RETURN